package org.enhance.common.util.encryption;

import org.apache.commons.net.util.Base64;

public class Base64Util {

	private Base64Util() {
		throw new IllegalStateException("Utility class");
	}

	public static String encode(String value) {
		if (value == null) {
			return null;
		}
		return Base64.encodeBase64URLSafeString(value.getBytes());
	}

	public static String decode(String value) {
		if (value == null) {
			return null;
		}
		return new String(Base64.decodeBase64(value));
	}

}